package edu.hawaii.ics414;

/**
 * Tries to login a user.
 */

import java.util.HashMap;
import java.util.Map;
import android.os.AsyncTask;

public class Login extends AsyncTask<String, Void, String> {

  @Override
  /*
   * Required by the AsyncTask class. Sends data to the appropriate php page for updates/queries
   * (non-Javadoc)
   * 
   * @params params A variable amount of Strings to send as form data.
   * 
   * @see android.os.AsyncTask#doInBackground(Params[])
   */
  protected String doInBackground(String... params) {
    String username = params[0];
    String password = params[1];
    
    Map<String, String> requestParams = new HashMap<String, String>();
    requestParams.put("username", username);
    requestParams.put("password", password);
    String response =
        Ajax.send("http://ratethatgame.web44.net/ics414/login.php", requestParams);
    return response;
  }

}
